package thread;

public class PriorityDemo {
    public static void main(String[] args) {
        Thread max = new Thread(()-> {
            for (int i = 0; i < 100; i++) {
                System.out.println("max");
            }
        });
        Thread min = new Thread(()-> {
            for (int i = 0; i < 100; i++) {
                System.out.println("min");
            }
        });
        Thread normal =new Thread(()-> {
            for (int i = 0; i < 100; i++) {
                System.out.println("normal");
            }
        });
        Thread thread = new Thread(){
            public void run(){
                for (int i = 0; i < 100; i++) {
                    System.out.println("thread");
                }
            }
        };
        max.setPriority(Thread.MAX_PRIORITY);
        min.setPriority(Thread.MIN_PRIORITY);
        normal.setPriority(Thread.NORM_PRIORITY);
        max.start();
        min.start();
        normal.start();
    }
}
